<!doctype html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"><head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
	<meta name="author" content="Coderthemes">
	
	<script src="/static/plugins/printWorld/PrintWorld.js"></script>
</head>
<body>
	
	<button type="button" onclick="doReview()">预览FBA箱标</button>
	<script>
	
	function doReview() {
		var urlPdf = "http://localhost:7020/profile/FBA15GP0BPX2.pdf";
		console.log(urlPdf);
		var json = {};
		json.action = "previewfile";	//打印指令动作。json.action = "preview"，则生成预览。
		json.format = "pdf_url";        //指定格式为pdf_url。
		json.docwidth = 20; // 单位：cm
		json.doclength = 30; // 单位：cm
		
		json.paperwidth = 10;
		json.paperlength = 10;
		json.content = urlPdf;   //pdf文件的url路径
		var pw = GetPrintWorld();    //获取打天下对象
		pw.Act(json);
	}
	
	function doPrint() {
		json.action = "print";
		var pw = GetPrintWorld();	//获取打天下对象
		pw.Act(json);
	}
	</script>
</body>
</html>